//
//  TAMTIndexController.swift
//  TAMeetApp
//
//  Created by Admin on 2024/11/28.
//

import UIKit

class TAMTIndexController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        tabBar.barTintColor = .white  // 设置 tabBar 背景色
        tabBar.tintColor = UIColor(red: 249/255.0, green: 74/255.0, blue: 71/255.0, alpha: 1)  // 设置选中项的颜色
        tabBar.unselectedItemTintColor = UIColor(red: 184/255.0, green: 187/255.0, blue: 190/255.0, alpha: 1)  // 设置未选中项的颜色


        // 创建视图控制器
        let homeNav = TAMTNavigationController.init(rootViewController: TAMTHomeController())
        let messagesVC = TAMTNavigationController.init(rootViewController: TAMTNewsListController())
        let profileVC = TAMTNavigationController.init(rootViewController: TAMTMineController())
        

        // 设置每个视图控制器的 tabBarItem
        homeNav.tabBarItem = UITabBarItem(title: "首页", image: UIImage(named: "tab_sy_n"), tag: 0)
        messagesVC.tabBarItem = UITabBarItem(title: "消息", image: UIImage(named: "tab_xx_n"), tag: 2)
        profileVC.tabBarItem = UITabBarItem(title: "我的", image: UIImage(named: "tab_wd_n"), tag: 3)

        // 将视图控制器添加到 TabBarController
        viewControllers = [homeNav, messagesVC, profileVC]
    }
}
